<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<link rel="stylesheet" href="/css/矢量图.css">
<link rel="stylesheet" href="/static/css/iconfont/iconfont.css">
<body>
<i  class="baidu iconfont iconbaidu"></i>
    <div th:fragment="nav">
        <nav class="navbar navbar-inverse">
            <div class="container-fluid" >
                <div class="navbar-header">
                    <!--<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only" href="/">Kris.Community</span>
                    </button>-->
<!--                    <a class="navbar-brand" href="/">Kris.Community</a>-->
                    <a href="/">
                        <span class="glyphicon glyphicon-home home navbar-brand"></span>
                    </a>
                </div>

                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <form class="navbar-form navbar-left" action="/" method="get">
                        <div class="form-group">
                            <input type="text" name="search" class="form-control" placeholder="搜索问题">
                        </div>
                        <button type="submit" class="btn btn-default">搜索</button>
                    </form>
                    <ul class="nav navbar-nav navbar-right">

                        <li>
                            <a href="http://www.baidu.com" target="_blank">百度</a>
                        </li>
                        <li th:if="${session.user!=null}">
                            <a href="/publish">提问</a>
                        </li>
                        <li>
                            <a href="/profile/replies">通知 <span class="badge" th:text="${session.unreadMessage}"></span></a>
                        </li>
                        <li class="dropdown" th:if="${session.user}!=null">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="dropdownMenu1" role="button" aria-haspopup="true" aria-expanded="false" >
                                <span th:text="${session.user.name}"></span>
                                <span class="caret"></span></a>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                <li><a href="/profile/questions">我的问题</a></li>
                                <li><a href="/logout">退出登录</a></li>
                            </ul>


                        </li>
                        <li th:if="${session.user!=null}" style="margin-right: -9px">
                            <div  style="margin-top: 6px;margin-left: 7px">
                                <div class="media-left">
                                    <a href="#">
                                        <img class="img-circle" style="width: 38px"
                                             th:src="${session.user.avatarUrl}">
                                    </a>
                                </div>
                            </div>
                        </li>

                        <li th:if="${session.user}==null">
<!--                            <a href="https://github.com/login/oauth/authorize?client_id=b5c58369cbc85cb2e5f1&redirect_uri=http://localhost:8080/callback&scope=user&state=1">登录</a>-->
                            <a th:href="@{https://github.com/login/oauth/authorize(client_id='b5c58369cbc85cb2e5f1',redirect_uri=${#httpServletRequest.getRequestURL()+'callback'},scope='user',state=1)}">登录</a>
                        </li>

                    </ul>
                </div>
            </div>
        </nav>
    </div>

</body>

</html>

</li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>
</body>
</html>